package com.rj.autofactory.service;

import com.rj.autofactory.table.ColumnEntity;
import com.rj.autofactory.table.DataBaseEntity;
import com.rj.autofactory.table.TableEntity;

import java.util.HashMap;
import java.util.Map;

/**
 * 生成结构处理
 *
 * @author YFX_RANLUBO
 * @date 2024/09/29 11:18
 **/
public class Handler {
    public static void main(String[] args) {
        //1.自动化工程处理业务逻辑
        //数据存储层（数据库）
        //1.1数据结构处理
        // 1）进行数据库结构定义
        TableEntity tableEntity = new TableEntity();
        ColumnEntity columnEntity = new ColumnEntity();


        //base基础能力
        //httpUtil、jdbcUtil;


    }


    class jdbcUtils {
        public String execute(String sql) {
            return sql;
        }

        public String createTable(DataBaseEntity dataBaseEntity,
                                  TableEntity tableEntity,
                                  ColumnEntity columnEntity) {
            //创建表模板
            String tableTpl = "create table ";
            //创建行模板
            String rowTpl = "`%s` %s %s %s %s";
            //创建索引模板
            String indexTpl = "index ";
            //获取数据库类型
            String type = dataBaseEntity.getType();
            Map<String, String> map = new HashMap<>();
            String name = tableEntity.getName();
            //创建表、索引
            //创建对应数据库实体
            return null;

        }


    }

}
